﻿using System;
using System.Collections.Generic;
using System.Text;
using ESoft.Specification;

namespace Test01
{
    public class EvenSpecification : CompositeSpecification<int>
    {
        public override bool IsSatisfiedBy(int candidate)
        {
            return candidate % 2 == 0;
        }
    }

    // 具体的规约，正数规约
    public class PlusSpecification : CompositeSpecification<int>
    {
        public override bool IsSatisfiedBy(int candidate)
        {
            return candidate > 0;
        }
    }
}
